<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询（media queries）功能 -->
    <!-- 警告：通过 file:// 协议（就是直接将 html 页面拖拽到浏览器中）访问页面时 Respond.js 不起作用 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
    <![endif]-->

    <!--引入bootstrap文件-->
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <!--引入index.css-->
    <link rel="stylesheet" href="css/landing.css">
    <!--引入ico小图标 -->
    <link rel="shortcut icon" href="favicon.ico"  type="image/x-icon"/>
    <title>云智教育</title>
    <script src="js/jquery-2.1.1.min.js"></script>
    <script src="js/zhangyue6.4.js"></script>
</head>
<body>
<header>
    <div class="container">
        <div class="row">
            <div class="col-md-5">
                <div class="fixed">
                    <!--左侧头部-->
                    <ul class="nav">
                        <li><a href="index.html">首页</a></li>
                        <li><a href="class_list.html">课程</a></li>
                        <!--<li><a href="#">职业规划</a></li>-->
                        <li><a onclick="_sousuo()" class="glyphicon glyphicon-search"></a></li>
                    </ul>
                    <!--左侧中间-->
                    <div class="middle">
                        <h3 class="word">登录或创建一个新账户</h3>
                        <span class="glyphicon glyphicon-user"></span>
                        <!--登录或注册-->
                        <ul class="landing">
                            <li><a href="landing.html">登录</a></li>
                            <li><a href="register.html" class="land">注册</a></li>
                            <li><a href="about.html">关于我们</a></li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="col-md-7 join-form">
                <div class="logo">
                    <img src="upload/logo.png" alt="">
                </div>
                <aside class="reg_form">
                    <form id="form">
                        <ul>
                            <li>
                                <label>手机号&nbsp;&nbsp;&nbsp;&nbsp;：</label>
                                <input type="tel" name="phone" placeholder="请输入手机号" class="border"></li>
                            <li>
                                <label>密码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;：</label>
                                <input placeholder="输入密码" type="password" name="password"  class="border nth2"></li>
                            <li>

                            <li>
                                <label>重复密码：</label>
                                <input placeholder="重复密码" type="password" name="passwordagain"  class="border nth2"></li>
                            <li>
                            <li>
                                <label>姓名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;：</label>
                                <input placeholder="输入你的姓名" type="text" name="name"  class="border nth2"></li>
                            <li>

                            <li><input onclick="zhuce()" type="button" value="注册" class="submit"></li>
                        </ul>
                    </form>
                </aside>
                <footer>
                    <div></div>
                </footer>
            </div>
        </div>
    </div>
</header>
<script>
    const zhuce = function(){
        let input = ipt.getshuru('form',['input']);
        if(ipt.checkinput(input)){
            let nr = ipt.gettext(input);
            if(nr.get('password')!=nr.get('passwordagain')){
                alert('两次密码不一致');
                return;
            }
            shuju.set('password',nr.get('password'));
            shuju.set('phone',nr.get('phone'));
            shuju.set('name',nr.get('name'));
            shuju.set('method','zhuce');
            shuju.getshuju('user',{
                success:function(data){
                    if(data.code==200){
                        mydata.set('info',data.data);
                        alert('注册成功');
                        window.location.href='index.html';
                    }else{
                        alert(data.data);
                    }
                },
                error:function(e){
                    alert('注册失败，请检查网络');
                }
            })

        }
    }
</script>
</body>
</html>